<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="container">
    <h3 align="center">模态框垂直居中</h3>
    <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#Modal">打开模态框</button>
    <div class="modal fade" id="Modal">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="modalTitle">终南望余雪</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal">
                        <span>&times;</span>
                    </button>
                </div>
                <div class="modal-body">终南阴岭秀，积雪浮云端。</div>
                <div class="modal-body">林表明霁色，城中增暮寒。</div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary">更多</button>
                </div>
            </div>
        </div>
    </div>

</body>

</html>